﻿<!DOCTYPE html>
<html>
<head>
    <title>Мы</title>

	<meta charset="UTF-8">
	
    <script src="/media/js/jquery.js"></script>
    <script src="/media/js/j.js"></script>
    <script src="/media/js/jquery.fancybox.js" ></script>
    <script src="/media/js/jquery-ui-1.8.16.custom.min.js" ></script>
    <link rel="stylesheet" href="/media/style/body.css">
    <link rel="stylesheet" href="/media/style/jquery.fancybox.css">
    <!--[if IE ]><link rel="stylesheet" href="/media/style/body_ie.css"><![endif]-->
    {% block scripts %}
    {% endblock %}

</head>
<body>
    <div class="wrapper">

<!--    header -->
		<div class="header_wrap">
	        <div class="header">
	        	<!--<div class="logo"><a href="/"><img src="/media/images/logo.png" width="122" height="42" /></a></div>-->
                <div class="logo"><a href="/"><img src="/media/images/avto.png" width="122" height="42" /></a></div>
	        	<ul class="main_menu">
	        		<li class="item"><a href="/companies/"><img class="icon" src="/media/images/icon_menu_company.png" width="48" height="40">Компании</a></li>
	        		<li class="item"><a href="/users/"><img class="icon" src="/media/images/icon_menu_users.png" width="48" height="40">Пользователи</a></li>
	        		<li class="item"><a href="/discussions/"><img class="icon" src="/media/images/icon_menu_debate.png" width="48" height="40">Обсуждения</a></li>
	        		<li class="item"><a href="/offers/"><img class="icon" src="/media/images/icon_menu_offer.png" width="48" height="40">Предложения</a></li>
	        	</ul>
	        	
	        	<div id="search_block" class="search_block">
                    <form action="/search/" method="post">
					<input id="search_q" name="search_q" class="search_q" type="text" value="" placeholder="Поиск">
					<ul class="where_to_look">
						<li class="item item_current"><label><input checked="checked" type="radio" name="where_to_look" value="1">По пользователям</label></li>
						<li class="item"><label><input type="radio" name="where_to_look" value="2">По компаниям</label></li>
						<li class="item"><label><input type="radio" name="where_to_look" value="3">По обсуждениям</label></li>
						<li class="item"><label><input type="radio" name="where_to_look" value="4">По предложениям</label></li>
                        <li class="item"><label><input type="radio" name="where_to_look" value="5">По заказам</label></li>
					</ul>
					<input class="submit" type="submit" value=""/>
	        	    </form>
                </div>
                <ul class="auth_menu">
	        		{% if request.user.is_anonymous %}
                        <li class="item"><a href="/accounts/register/">Регистрация</a></li>
                        <li class="item"><a class="for_popup" href="#popup_auth">Войти</a></li>
                    {% else %}
                        <li class="item"><a href="/accounts/logout/">Выйти</a></li>
                    {% endif %}
	        	</ul>
	        </div>
		</div>
<!--    /header -->

<!--    content -->
        <div class="content">
        	<div class="sidebar_l">
        		<!--
                <div class="region_select">
					<div class="current_val">Выбрать регион</div>
                    <ul class="selected_list">

                        <li class="item" selected="selected"><a href="">Белгородская область</a></li>
						<li class="item"><a href="">Белгородская область</a></li>
						<li class="item"><a href="">Белгородская область</a></li>

					</ul>
				</div>
                -->
				
				<ul class="side_menu">
					<li class="item item_current">
						<div class="item_h">Категории</div>
						<ul class="submenu">
							{% for category in info.categories %}
                            <li class="subitem"><a href="/by_category/{{ category.id }}/">{{ category.name }}</a></li>
                            {% endfor %}
						</ul>
					</li>

				</ul>
				
				{% if request.user.is_authenticated %}
                <div class="base_block base_block_side">
					<h2 class="block_header">Друзья онлайн</h2>
				
					<ul class="block_content user_list user_list_side">
						{% for friend in request.user.user_info.friends.all %}
                            {% if forloop.counter0 < 16 %}
                            {% if friend.user_info.online %}
                            <li class="item">
                            <a href="/profile/{{ friend.id }}/">
                                 <img class="pic"
                                 {% if friend.user_info.avatar %}
                                    src="{{ friend.user_info.avatar.url }}"
                                    {% if friend.user_info.avatar.width > friend.user_info.avatar.height %}
                                    width="47"
                                    {% else %}
                                    height="47"
                                    {% endif %}
                                 {% else %}
                                    src="/media/images/nophoto.jpg/"
                                    width="47" height="47"
                                 {% endif %}
                                 />{{ friend.user_info.first_name }} {{ friend.user_info.last_name }}
                            </a>
                            </li>
                            {% endif %}
                            {% endif %}
                        {% endfor %}
					</ul>
				</div>
                {% endif %}

				
				<div class="base_block base_block_side">
					<h2 class="block_header">Компании онлайн</h2>
				
					<ul class="block_content user_list user_list_side">
                     {% for company in info.online_companies %}
                        {% if forloop.counter0 < 16 %}
						<li class="item">
                            <a href="/company/{{ company.id }}/">
                                <img class="pic"
                                {% if company.logo %}
                                    src="{{ company.logo.url }}"
                                    {% if company.logo.width > company.logo.height %} width="47" {% else %} height="47" {% endif %}
                                 {% else %}
                                    src="/media/images/img_no.gif" width="47" height="47"
                                {% endif %}
                                />
                                {{ company.name }}
                            </a>
                        </li>
                         {% endif %}
                      {% endfor %}
					</ul>
				</div>


				<div class="base_block base_block_side">
					<h2 class="block_header">Обсуждения</h2>

					<ul class="block_content debate_list">
						{% for discussion in info.discussions %}
                        {% if forloop.counter0 < 10 %}
                            <li class="item">
							<h3 class="cat"><a href="/discussion/{{ discussion.id }}/">{{ discussion.subj }}</a> <span class="icon"></span></h3>
							{% if discussion.get_last_post %}
                            <div class="author">
                                <a href="/profile/{{ discussion.get_last_post.publisher.id }}/">
                                    {{ discussion.get_last_post.publisher.user_info.last_name }} {{ discussion.get_last_post.publisher.user_info.first_name }}
                                </a> <span class="icon"></span>
                            </div>
                            {% endif %}
							<div class="mess_num">{{ discussion.messages.count }} сообщений</div>
							{% if discussion.get_last_post %}
                            <div class="date">{{ discussion.get_last_post.post_date }}</div>
                            {% endif %}
						</li>
                        {% endif %}
                        {% endfor %}
					</ul>
				</div>
        	</div>
        	
        	<div class="sidebar_r">        		
				<ul class="side_menu">
					<li class="item">
						<div class="item_h">Мы-маркет</div>
						<ul class="submenu">
							<li class="subitem"><a href="#">мы туризм</a></li>
							<li class="subitem"><a href="#">мы авто</a></li>
							<li class="subitem"><a href="#">мы одежда</a></li>
						</ul>
					</li>
				</ul>
				{% if request.user.is_authenticated %}
                <div class="profile_block_side">
					<dl class="base_info">
                        <dt class="name">
                            {{ request.user.user_info.last_name }} {{ request.user.user_info.first_name }} (Это Вы)
                            {% if request.user.user_info.avatar %}
                                <img class="userpic" src="{{ request.user.user_info.avatar.url }}"
                                 {% if request.user.user_info.avatar.width > request.user.user_info.avatar.height %}
                                    width="79"
                                    {% else %}
                                    height="79"
                                    />
                                {% endif %}
                            {% else %}
                                <img class="userpic" src="/media/i/img_1.png" width="79" height="79"/>
                            {% endif %}

                        </dt>
							<dd><a href="/user_companies/{{ request.user.id }}/">Компании</a></dd>
							<dd><a href="/settings/private/">Настроить</a></dd>
					</dl>
					<ul class="info">
						<li class="item">
                            <a href="/all_dialogs/">
                            <img class="icon" src="/media/images/icon_profile_info_messages.gif" width="19" height="12"> {% if request.user.user_info.get_unreaded_messages.count > 0 %}{{ request.user.user_info.get_unreaded_messages.count }}{% endif %}
                            </a>
                        </li>
						<!--<li class="item"><img class="icon" src="/media/images/icon_profile_info_user.gif" width="12" height="12"> 2</li> -->
						<li class="item">
                            <a href="/user_companies/{{ request.user.id }}/">
                            <img class="icon" src="/media/images/icon_profile_info_company.gif" width="26" height="12"> {% if request.user.companies.count > 0 %}{{ request.user.companies.count }}{% endif %}
                            </a>
                        </li>
					</ul>

					<ul class="profile_menu">
						<li class="item"><a href="/profile/{{ request.user.id }}/">Кабинет</a></li>
						<li class="item"><a href="/friends/">Друзья</a></li>
                        {% if request.user.invitations_to.count > 0 %}
                            <li class="item"><a href="/possible_friends/"><strong>Заявки в друзья</strong></a></li>
                        {% endif %}
						<li class="item"><a href="/all_dialogs/">Общение</a></li>
						<li class="item"><a href="/orders/">Заказы</a></li>
						<li class="item"><a href="/settings/private/">Настройки</a></li>
					</ul>
				</div>
                {% endif %}
        	</div>
        	<div class="base_content">
                {% block content %}
                {% endblock %}
			</div>
        </div>
<!--    /content -->   

    </div>
	
<!--    footer -->
		<div class="footer_wrap">
	        <div class="footer">
	        	<div class="copy_end_develop">
		        	<p class="copy">Мы-маркет.рф 2011 &copy;</p>
		        	<p class="develop">nanomediagroup - <a href="http://www.nanomediagroup.ru">создание сайтов в Белгороде</a></p>
	        	</div>
	        	<div class="info">
		        	<ul class="menu">
						<li class="item"><a href="/about/">О проекте</a></li>
						<li class="item"><a href="/support/">Техподдержка</a></li>
						<li class="item"><a href="/rules/">Правила</a></li>
						<li class="item"><a href="/contacts/">Контакты</a></li>
					</ul>
					<ul class="methers">
						<li class="item"><a href="#"><img src="/media/i/img_meter_1.gif"></a></li>
						<li class="item"><a href="#"><img src="/media/i/img_meter_2.gif"></a></li>
					</ul>
				</div>
	        </div>
        </div>
<!--    /footer -->

<div style="display: none;">
	<div id="popup_auth" class="popup">
		<div class="popup_in auth_block">
			<form class="form_2" id="id_login_form" action="" method="post">
				<h2 class="block_header">Авторизация</h2>
				<dl>
					<dt><label for="id_username">E-mail или логин:</label></dt>
						<dd><input id="id_username" name="username" class="text_input" type="text"></dd>
					<dt><label for="id_password">Пароль:</label></dt>
						<dd><input id="id_password" name="password" class="text_input" type="password"></dd>
				
				</dl>
				<div class="buttons"><input class="button" type="submit" value="Войти"></div>
				
				<ul class="options">
					<li class="item"><a href="/accounts/password/reset/">Забыли пароль?</a></li>
					<li class="item"><a href="/accounts/register/">Зарегистрироваться</a></li>
				</ul>
			</form>
		</div>
	</div>
</div>

</body>
</html>